﻿@model IEnumerable<QuanLyGiaoVuUI.Models.GiangVien.GiangVienViewModel>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_blueWhaleLayout.cshtml";
}

<style>
    td {
        text-align: center;
    }
    table.display {
        width: 100%;
        float: left;
    }
    .danhsachgv {
        height: 500px;
        width: 250px;
        overflow: auto;
        float: left;
    }
    th.table-header {
        background: gray;
        color: white;
    }
    .box.first {
        overflow:auto;
    }
    .thongkegiangdaygv {
        padding:10px;
    }    
    .editor-field {
        margin-top: 20px;
        margin-left: 50px;
    }
    table.display tr {
        cursor:pointer;
    }
</style>

@{Html.RenderPartial("GiangVienMenuPartial");}

<div id="main" class="grid_10">
    <!--  start page-heading -->

    <div id="page-heading" class="box round first grid">
        <h2>Danh sách giảng viên</h2>        
        <!-- end page-heading -->
        <div class="danhsachgv">           
                
                <table class="data display datatable">
                    <tr>
                        <th class="table-header">Mã giảng viên</th>
                        <th class="table-header">Họ và tên</th>
                    </tr>
                    @if (Model.Count() == 0)
                    {
                        <tr>
                            <span>Không có dữ liệu!</span>
                        </tr>
                    }
                    else
                    {
                        var count = 0;
                        foreach (QuanLyGiaoVuUI.Models.GiangVien.GiangVienViewModel viewModel in Model)
                        {
                        <tr class="gradeA @(++count % 2 == 0 ? "even" : "odd") itemGV" aria-valuetext="@viewModel.ID">
                            <td>@viewModel.MaGiangVien</td>
                            <td style="text-align: left">@viewModel.GetTenVaHocVi() @(viewModel.ThinhGiang?"(GVTG)":"")</td>
                        </tr>
                        }
                    }
                </table>
                <!--  end product-table................................... -->
        </div>
        <div class="block" >
            <h2><span>Thống kê giảng dạy </span><span id="hkhientai"></span></h2>
            <div id="dshocky">
            </div>
            <div id="mainThongKeGV">

            </div>
        </div>
    </div>
</div>
<div><input type="hidden" id="curID" value="" /></div>
<div class="clear">&nbsp;</div>

<script>  
    $(document).ready(function () {
        $('#dshocky').load("/GiangVien/DanhSachHocKy");
        //$("#hkhientai").load("/Common/HocKyHienTai");
        $(".itemGV").click(function () {
            var magv = $(this).attr("aria-valuetext");
            $("#curID").val(magv);
            var hkhientai = $("#HocKyHienTai_MaHocKy").val();
            $("#mainThongKeGV").load("/GiangVien/ThongKeGiangVien?magv=" + magv+"&mahk="+hkhientai);
        });        

        


    });
</script>
